package com.tj.bo.user.server.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.tj.bo.user.server.dao.UserWanningListDao;
import com.tj.bo.user.server.entity.UserWanningListEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

/**
* User: anonymous
* Date: 2020-08-21
* Time: 15:43:35.057
*/

@Repository
public class UserWanningListDaoImpl extends AbstractBaseMapper<UserWanningListEntity> implements UserWanningListDao {


    @Override
    public UserWanningListEntity getLatestOneByDeviceId(String deviceId) {

        Map<String, Object> params = new HashMap<>();
        params.put("deviceId", deviceId);
        return getSqlSession().selectOne(this.getStatement("getLatestOneByDeviceId"), params);
    }

    @Override
    public UserWanningListEntity getUserWarningByCondition(String deviceId, String userCode, Integer type) {
        Map<String, Object> params = new HashMap<>();
        params.put("deviceId", deviceId);
        params.put("userCode", userCode);
        params.put("type", type);
        return getSqlSession().selectOne(this.getStatement("getUserWarningByCondition"), params);
    }
}